package com.xon.lotp.controller;

import com.xon.lotp.pojo.Project;
import com.xon.lotp.service.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Controller
@CrossOrigin // 跨域处理

public class ProjectController {

    @Autowired
    ProjectService projectService;

    @ResponseBody
    @RequestMapping(value = "/viewProjectInfo",method = RequestMethod.POST)
    public Project viewProjectInfo( String projectId, String preferredLanguage) {
        Project project;
        project = projectService.viewProjectInfo(projectId,preferredLanguage);
        return project;
    }

    @ResponseBody
    @RequestMapping("/createProject")
    public void createProject (@RequestBody Project project){
        System.out.println("111");
        System.out.println(project);
    }

}
